package com.bckj.fastboot.core.extra.license.configuration;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.io.Serial;
import java.io.Serializable;

/**
 * License校验类需要的参数
 * license.subject=your_license_subject
 * license.publicAlias=publicCert
 * license.storePass=public_password1234
 * license.licensePath=/path/to/your/license.lic
 * license.publicKeysStorePath=/path/to/publicCerts.keystore
 */
@Getter
@Setter
@ToString
@ConfigurationProperties(prefix = "fastboot.license")
public class LicenseVerifyProperties implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    
    /**
     * 证书主题
     */
    private String subject;
    
    /**
     * 公钥别称
     */
    private String publicAlias;
    
    /**
     * 密钥库密码
     */
    private String storePass;
    
    /**
     * 许可证文件路径
     */
    private String licensePath;
    
    /**
     * 公钥库存储路径
     */
    private String publicKeysStorePath;
    /**
     * 是否启用缓存
     */
    private boolean cacheEnabled = false;
    /**
     * 缓存key
     */
    private String cacheKey = "GLOBAL_LICENSE_STATUS";
    /**
     * 缓存TTL
     */
    private Integer cacheTTL = 300;

}